import matplotlib.pyplot as plt


'''
    显示前5000个整数的立方值，并指定颜色映射
'''
x_nums = list(range(5000))
y_nums = [x*x*x for x in x_nums]
print(max(y_nums))

plt.scatter(x_nums, y_nums, c=y_nums, cmap=plt.cm.Reds, s=10)

plt.title('x*x*x', fontsize=18)
plt.xlabel('x_nums', fontsize=14)
plt.ylabel('y_nums', fontsize=14)
plt.tick_params(axis='both', which='major', labelsize=14)

plt.axis([0, len(x_nums), 0, max(y_nums)])

plt.savefig('ex2.png')

plt.show()
